Skip to content

Conversation

@iuwqyir
Copy link
Contributor

@iuwqyir iuwqyir commented Apr 23, 2025

TL;DR

Fixed a bug in the InsertBlockData function where negative block signs were not being properly handled.

What changed?

Modified the condition in InsertBlockData that determines when to use the block's sign value. Previously, the code would only use the block's sign if it wasn't equal to 1, but now it specifically checks if the sign is -1. This ensures that only explicitly negative signs are treated differently.

How to test?

  1. Insert block data with different sign values (-1, 0, 1)
  2. Verify that only blocks with sign = -1 are stored with a negative sign
  3. Verify that blocks with sign = 0 are stored with the default sign value of 1

Why make this change?

The previous implementation had a logic error where any sign value that wasn't 1 (including 0) would be used as-is. This could lead to incorrect sign values being stored in the database. The fix ensures that only explicitly negative signs (-1) are preserved, while all other values default to positive (1).

Copy link
Contributor Author

iuwqyir commented Apr 23, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@iuwqyir iuwqyir marked this pull request as ready for review April 23, 2025 09:03
@iuwqyir iuwqyir merged commit 4e6ed3f into main Apr 23, 2025
5 checks passed
@iuwqyir iuwqyir deleted the 04-23-fix_sign_on_insert branch April 23, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants